package com.itlong.cloud.iottp;

import com.itlong.cloud.POJO.DTO.operate.OperateOSSCallBackDTO;
import com.itlong.cloud.POJO.VO.operate.OperateOSSTokenVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <desc>
 *      阿里OSS接口。
 * <desc/>
 *
 * @createDate 2018/07/12.
 */
@FeignClient(name = "iot-tp-service")
public interface IIotAliOSSServiceClient {

    /**
     * <desc>
     *      获取阿里OSS通行证
     * <desc/>
     *
     * @return
     * @author Qiang.S
     * @createDate 2018/07/13
     */
    @RequestMapping(path = "/iotTp/aliOSS/getOSSToken",method = RequestMethod.POST)
    OperateOSSTokenVO getOSSToken();

    /**
     * <desc>
     *      处理阿里OSS回调信息
     * <desc/>
     *
     * @param  operateOSSCallBackDTO  OSS回调信息
     * @return
     * @author Qiang.S
     * @createDate 2018/07/12
     */
    @RequestMapping(path = "/iotTp/aliOSS/OSSCallBack",method = RequestMethod.POST)
    boolean OSSCallBack(@RequestBody OperateOSSCallBackDTO operateOSSCallBackDTO);

    /**
     * <desc>
     *     删除OSS中文件
     * </desc>
     *
     * @param updateNames 文件名称,逗号分隔
     * @return
     * @author Qiang.S
     * @createDate 2018/10/09
     */
    @RequestMapping(path = "/iotTp/aliOSS/deleteFile",method = RequestMethod.POST)
    void deleteFile(@RequestParam("updateNames") String updateNames);

    /**
     * <desc>
     *      获取阿里OSS通行证
     * <desc/>
     *
     * @return
     * @author wangzhi
     * @createDate 2018/11/22
     */
    @RequestMapping(path = "/iotTp/aliOSS/getMediaOSSToken",method = RequestMethod.POST)
    OperateOSSTokenVO getMediaOSSToken();

    /**
     * <desc>
     *      处理阿里OSS回调信息
     * <desc/>
     *
     * @param  operateOSSCallBackDTO  OSS回调信息
     * @return
     * @author Qiang.S
     * @createDate 2018/07/12
     */
    @RequestMapping(path = "/iotTp/aliOSS/OSSMediaCallBack",method = RequestMethod.POST)
    boolean OSSMediaCallBack(@RequestBody OperateOSSCallBackDTO operateOSSCallBackDTO);
    /**
     * <desc>
     *      下载文件
     * <desc/>
     *
     * @param  fileName  文件名称
     * @param  filePath  文件路径
     * @return
     * @author maju
     * @createDate
     */
    @RequestMapping(path = "/iotTp/aliOSS/downloadFile",method = RequestMethod.GET)
    boolean downloadFile(@RequestParam("fileName")String fileName,@RequestParam("filePath")String filePath);
}
